package com.ruoyi.bizsys.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.bizsys.domain.LoanIou;
import com.ruoyi.bizsys.domain.ProductInfo;
import com.ruoyi.bizsys.domain.RepaymentOrder;

import java.util.List;

/**
 * 还款管理Service接口
 *
 * @author african-loan
 * @date 2021-12-30
 */
public interface IRepaymentOrderService extends IService<RepaymentOrder>{
    /**
     * 查询还款管理
     *
     * @param id 还款管理ID
     * @return 还款管理
     */
    public RepaymentOrder selectRepaymentOrderById(Long id);

    /**
     * 查询还款管理列表
     *
     * @param repaymentOrder 还款管理
     * @return 还款管理集合
     */
    public List<RepaymentOrder> selectRepaymentOrderList(RepaymentOrder repaymentOrder);

    public List<RepaymentOrder> getList(RepaymentOrder repaymentOrder);



    /**
     * 新增还款管理
     *
     * @param repaymentOrder 还款管理
     * @return 结果
     */
    public int insertRepaymentOrder(RepaymentOrder repaymentOrder);

    /**
     * 修改还款管理
     *
     * @param repaymentOrder 还款管理
     * @return 结果
     */
    public int updateRepaymentOrder(RepaymentOrder repaymentOrder);

    /**
     * 批量删除还款管理
     *
     * @param ids 需要删除的还款管理ID
     * @return 结果
     */
    public int deleteRepaymentOrderByIds(Long[] ids);

    /**
     * 删除还款管理信息
     *
     * @param id 还款管理ID
     * @return 结果
     */
    public int deleteRepaymentOrderById(Long id);

    /**
     * 代扣成功银行卡数
     * @param custNo
     */
    int getWithholdCardCount(String custNo);


    RepaymentOrder getDetail(String repaymentNo);

    RepaymentOrder getDetailByPayTransSerialNo(String serialNo);

    /**
     * 参数实体，返回详情
     *
     * @param repaymentOrder
     * @return
     */
    RepaymentOrder getDetail(RepaymentOrder repaymentOrder);

    RepaymentOrder getDetailByPayTransSerialNoStatusSucc(String payTransSerialNo);

    void updateRepayStatusToFaild(String createTime);

    List<ProductInfo> selectCreditAccountProduct(String custNo);

    void updateRepaymentOrderAndOffsetFaild(RepaymentOrder repaymentOrder);

    /**
     * 创建状态为2的订单，此时金额不一定正确
     * @param loanIou
     * @return
     */
    RepaymentOrder createRepaymentOrderToWait(LoanIou loanIou,String actionType,String paymentReference);

    void updateRepayStatusToFaildByPayTransSerialNo(String walletNo);
}
